//
//  DCFlagView.m
//  CustomPicker
//
//  Created by Joinwe on 16/3/24.
//  Copyright © 2016年 Joinwe. All rights reserved.
//

#import "DCFlagView.h"
#import "DCFlag.h"


@interface DCFlagView()

@property (weak, nonatomic) IBOutlet UIImageView *flagImage;

@property (weak, nonatomic) IBOutlet UILabel *flagName;

@end


@implementation DCFlagView



+ (instancetype)flagViewWithPickerView:(UIPickerView *)pickerView{
    return  [[NSBundle mainBundle] loadNibNamed:@"DCFlagView" owner:nil options:nil].lastObject;
}

- (void)setFlag:(DCFlag *)flag{
    _flag = flag;
    
    self.flagName.text = flag.bankName;
    self.flagImage.contentMode = UIViewContentModeCenter;
    self.flagImage.image = [UIImage imageNamed:flag.bankIcon];
    
}


+(CGFloat)flagViewHeight{
    return 44;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
